import { createRouter, createWebHistory } from 'vue-router'

import IconView from '../views/IconDemo.vue'
import TreeView from '../views/TreeDemo.vue'
import CheckBoxView from '../views/CheckBoxDemo.vue'
import ButtonView from '../views/ButtonDemo.vue'
import InputView from '../views/InputDemo.vue'
import FormView from '../views/FormDemo.vue'

const routes = [
  { path: '/', redirect: '/demo-icon' },
  {
    path: '/demo-icon',
    component: IconView,
    name: 'icon',
    meta: {
      name: 'icon组件'
    }
  },
  {
    path: '/demo-tree',
    component: TreeView,
    name: 'tree',
    meta: {
      name: 'tree组件'
    }
  },
  {
    path: '/check-ox',
    component: CheckBoxView,
    name: 'check-box',
    meta: {
      name: 'check-box组件'
    }
  },
  {
    path: '/demo-button',
    component: ButtonView,
    name: 'button',
    meta: {
      name: 'button组件'
    }
  },
  {
    path: '/demo-input',
    component: InputView,
    name: 'input',
    meta: {
      name: 'input组件'
    }
  },
  {
    path: '/demo-form',
    component: FormView,
    name: 'frpm',
    meta: {
      name: 'form组件'
    }
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
